import {Toast} from 'mint-ui';
const myalert = {};
myalert.instance = null;
myalert.success = msg => {
  myalert.instance = Toast ({
    message: msg,
    iconClass: 'iconfont  icon-success',
  });
};
myalert.fail = msg => {
  myalert.instance = Toast ({
    message: msg,
    iconClass: 'iconfont icon-failed',
  });
};
myalert.loading = () => {
  myalert.instance = Toast ({
    duration: -1,
    message: 'loading....',
    iconClass: 'iconfont icon-loading',
  });
};
myalert.close = () => {
  myalert.instance.close ();
};
myalert.clear = () => {
  myalert.instance.close ();
};

export default myalert;
